package com.tensai.teach.luogu;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @author Tensai
 */
public class P1002 {
    static int[][] map;
    static int a, b, c, d;

    public static void main(String[] args) throws Exception {
        Scanner cin = new Scanner(System.in);
        a = cin.nextInt();
        b = cin.nextInt();
        c = cin.nextInt();
        d = cin.nextInt();
        if (c > a || d > b) {
            return;
        }
        map = new int[a + 1][b + 1];
        initMap(c, d);
        count(a, b);

        System.out.println(map[a][b]);
    }

    private static void initMap(int c, int d) {
        setNan(c, d);
        setNan(c + 1, d + 2);
        setNan(c - 1, d + 2);
        setNan(c + 2, d + 1);
        setNan(c - 2, d + 1);
        setNan(c + 1, d - 2);
        setNan(c - 1, d - 2);
        setNan(c + 2, d - 1);
        setNan(c - 2, d - 1);
        map[0][0] = 1;
        if (map[0][b] == 0) {
            map[0][b] = 1;
        }
        if (map[a][0] == 0) {
            map[a][0] = 1;
        }
        if (c - 2 > 0 && d + 2 < b) {
            map[c - 1][d + 1] = 1;
            map[c - 2][d + 2] = 1;
        }
        if (c + 2 < a && d - 2 > 0) {
            map[c + 1][d - 1] = 1;
            map[c + 2][d - 2] = 1;
        }
    }

    private static void setNan(int x, int y) {
        if (x < 0 || x > a || y < 0 || y > b) {
            return;
        } else {
            map[x][y] = -1;
        }
    }

    private static int count(int m, int n) {
        if (m < 0 || m > a || n < 0 || n > b) {
            return 0;
        } else if (map[m][n] == -1) {
            return 0;
        } else {
            if (map[m][n] != 0) {
                return map[m][n];
            } else {
                int res = count(m - 1, n) + count(m, n - 1);
                map[m][n] = res;
                return res;
            }
        }
    }
}
